home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
progs
/
editor
/
frexxed
/
fpl
/
latex_gotosection.fpl
< prev
next >
Wrap
Text File
|
1995-08-24
|
1KB
|
52 lines
export void LaTeX_GotoSection()
{
int line = ReadInfo("line");
int col = ReadInfo("byte_position");
string labels[100];
int linenum[100];
string junk;
int numoflab=0;
int size=100;
const string validlabel= "section{|chapter{|part{";
int moved;
Visible(0);
GotoLine(1); /* from the start! */
while(!Search(validlabel, "wf+")) {
linenum [ numoflab ] = ReadInfo("line");
labels[ numoflab ] = substr( GetLine(ReadInfo("line")),0,(strlen(GetLine(ReadInfo("line")))-1));
numoflab++;
if(numoflab == size) {
/* Filled up the arrays, increase the sizes! */
size += 100;
resize labels[size];
resize linenum[size];
}
}
if(numoflab) {
string selection;
/* we've found some labels */
if(RequestWindow("Jump to label",
"", "A", &labels, &selection, numoflab) &&
strlen(selection)) {
/* We have an OK! */
int a;
while(a < numoflab) {
if(!strcmp(selection, labels[a])) {
/* this is the label! */
GotoLine(linenum[a]); /* jump to the label! */
return;
}
a++;
}
}
}
else
ReturnStatus("No labels found!");
if(!moved)
GotoLine(line, col); // get back to start
}